package com.ysd.lis.controller;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkScheRecs;
import com.ysd.lis.request.UploadFileParams;
import com.ysd.lis.service.WkScheRecsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 排班信息表 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2024-02-28
 */
@RestController
@RequestMapping("/wk/scheRecs")
public class WkScheRecsController extends BaseController {

    @Autowired
    WkScheRecsService wkScheRecsService;

    @GetMapping("/getColumnData/{dateString}")
    public Result getColumnData(@PathVariable("dateString") String dateString) {
        return wkScheRecsService.getColumnData(dateString);
    }

    @PostMapping("/saveBatchSche")
    public Result saveBatchSche(@RequestBody List<WkScheRecs> scheRecs) {
        return wkScheRecsService.saveBatchSche(scheRecs);
    }

    @DeleteMapping("/deleteByEmployeeId")
    public Result deleteByEmployeeId(@RequestParam("employeeId") String employeeId, @RequestParam("recDate") String recDate) {
        return wkScheRecsService.deleteByEmployeeId(employeeId, recDate);
    }

    @DeleteMapping("/deleteScheRecsByDate")
    public Result deleteScheRecsByDate(@RequestParam("employeeId") String employeeId, @RequestParam("recDate") String recDate) {
        return wkScheRecsService.deleteScheRecsByDate(employeeId, recDate);
    }

    @GetMapping("/quicklyNextMonthScheRecs")
    public Result quicklyNextMonthScheRecs(@RequestParam("currentMonth") String currentMonth) {
        return wkScheRecsService.quicklyNextMonthScheRecs(currentMonth);
    }

    @GetMapping("/lisDeptDataImport")
    public Result lisDeptDataImport(@RequestParam("recDate") String recDate) {
        return wkScheRecsService.lisDeptDataImport(recDate);
    }

    @PostMapping("/importExcelData")
    public Result importExcelData(UploadFileParams uploadFileParams) {
        return wkScheRecsService.importExcelData(uploadFileParams);
    }

}
